import urllib.request
from script.get_user_info.config.codeforces_config import cf_headers

# 获得用户主页的html
def cf_response(name):
    baseurl = "https://codeforces.com/profile/" + name
    request = urllib.request.Request(url=baseurl, headers=cf_headers)
    response = urllib.request.urlopen(request)
    return response.read().decode('utf-8')


if __name__ == '__main__':
    print(cf_response('S_zhi'))
